import service, {get, post} from '@/utils/request'

const servletMap = [
    // ['/web/subject/query', 'query', 'post'],
    // ['/web/product/pageList', 'pageList', 'post'],



    ['/exam/package/list-by-exam', 'packageList', 'post'],

    // ['/exam/industry/app/list','industryList','get'],
    ['/exam/industry/list', 'industryList', 'get'],
    ['/exam/exam/exam-by-pc', 'examList', 'get'],
    ['/exam/exam/index/searchExam', 'searchExam', 'get'],//examType/searchKey/groupId
    ['/exam/package/sku/list', 'skuList', 'get'],
    ['/exam/category/leaf-list', 'leafList', 'get'],
    ['/exam/category/leaf-list-pc','leafListPc','get'],

    ['/exam/exam/exam-by-industryId-app', 'examByIndustry', 'get'],
    ['/exam/column/column-by-category', 'columnByCategory', 'get'],
    ['/exam/chapter/chapter-by-columnId', 'chapterList', 'get'],
    ['/exam/chapter/all-parent-ids', 'allParent', 'get'],
    // ['/my/exam/chapter/get','chapterList','get'],

    ['/exam/chapter/child-chapter', 'childChapter', 'get'],
    // searchCount examId title industryId
    ['/advertisement/list','advertisementList', 'get'],
    ['/exam/column/columnsByIds', 'listByColumnIds', 'get'],
    // 根据栏目拉资料，materialInfoByColumnIdPage，资料id对应ex_column_config_re.config_id
    ['/material/info/material-by-columnId','materialByColumnId','get']

]
let obj = {}
for (let i in servletMap) {
    obj[servletMap[i][1]] = function () {
        return service[servletMap[i][2]](servletMap[i][0], ...arguments);
    }
}

export default {
    ...obj,
    // packageList(examId){
    //     return post('/exam/package/list-by-exam',null,{params:{examId}})
    // },
    questionCollection(params) {
        return post('/exam/records/question-collection', params, {
            headers: {
                'encryption-type': 'rsa',
                'content-type': 'application/json; charset=UTF-8'
            }
        })
    },
    categoryDetail(id){
        return service.get("/exam/category/detail/"+id);
    }
};